package com.priox.sigar.jsf;


import com.mm.seguridad.dto.UsuarioDTO;
import com.priox.sigar.jsf.util.FindCrudBeanBase;
import org.primefaces.event.CloseEvent;
import org.primefaces.event.SelectEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.event.ActionEvent;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: kvallejos
 * Date: 15/12/11
 * Time: 10:17 AM
 * To change this template use File | Settings | File Templates.
 */
@ManagedBean
@Scope("session")
@Component
public class InfoUsuarioBean extends FindCrudBeanBase {
    private static final Logger LOG = LoggerFactory.getLogger(InfoUsuarioBean.class);

    private UsuarioDTO usuario = new UsuarioDTO();

    @PostConstruct
    public void init() {
        LOG.info("Inicializando InfoUsuarioBean ");
        setName(" ");
    }

    @Override
    public void onClean(ActionEvent actionEvent) {

    }

    @Override
    public void setCursorTableNull() {
    }

    @Override
    public void onNewRecord(ActionEvent actionEvent) {
    }

    @Override
    public void onFind(ActionEvent actionEvent) {

    }

    @Override
    public void onPersist(ActionEvent actionEvent) {


    }


    @Override
    public void onDelete(ActionEvent actionEvent) {

    }

    @Override
    protected void onDialogClose(CloseEvent event) {


    }


    public void onEditDialogOpen(ActionEvent actionEvent) {

    }


    public void onViewDialogOpen(ActionEvent actionEvent) {


    }


    //================================================================================
    // Modal Handlers
    //================================================================================


    @Transactional
    public void onPerfilRowSelect(SelectEvent se) {



    }


    public UsuarioDTO getUsuario() {
        return usuario;
    }

    public void setUsuario(UsuarioDTO usuario) {
        this.usuario = usuario;
    }



    public Date getServerTime(){
        return new Date();
    }
}
